package example.entities.mobile 
{
	import example.globals.Assets;
	import net.flashpunk.Entity;
	import maskedpixel.ogmo.*;
	import maskedpixel.ogmo.utils.*;
	import net.flashpunk.Graphic;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.Mask;
	
	/**
	 * ...
	 * @author MaskedPixel
	 */
	public class MovingPlatform extends Entity 
	{
		/**
		 * @inheritDoc
		 */
		public function MovingPlatform(x:Number=0, y:Number=0, graphic:Graphic=null, mask:Mask=null) 
		{
			super(x, y, graphic, mask);
			
			this.graphic = new Image(Assets.MOVING_PLATFORM_GFX);
		}
		
		/**
		 * Used to register this class with the Ogmo Project.
		 */
		public static function register():void
		{
			var movingPlatform:OgmoObject = new OgmoObject("example.entities.mobile.MovingPlatform", "moving_platform", "moving_platform.png", 16, 16);
			movingPlatform.registerAttribute(new OgmoAttribute("resizableX", "true"),
											new OgmoAttribute("resizableY", "true"),
											new OgmoAttribute("tile", "true"))
											
			movingPlatform.registerValue(new OgmoValue(OgmoValue.NUMBER, "speed", "1", 5, 0.1));
			
			movingPlatform.registerNode(new OgmoNode(true, 2, 3));
			
			OgmoProject.registerObject(movingPlatform);
		}
		
	}

}